import * as React from 'react';
import {Provider} from 'react-redux';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import ContentContainer from './src/pages/configureAppContainer';
import {PersistGate} from 'redux-persist/integration/react';
import {persistor, store} from './src/store/configureStore';
import Loading from './src/components/Loading';
import DropdownAlert from 'react-native-dropdownalert';
import {ToastManger} from './src/components/Toast';
import {STYLE_COLOR} from './src/variables';

export default function App() {
  return (
    <SafeAreaProvider>
      <Provider store={store}>
        <PersistGate loading={<Loading />} persistor={persistor}>
          <ContentContainer />
        </PersistGate>
      </Provider>
      <DropdownAlert
        ref={ref => ref && ToastManger.setDropDownAlertRef(ref)}
        successColor={STYLE_COLOR.GREEN}
        errorColor={STYLE_COLOR.RED}
        infoColor={STYLE_COLOR.BLUE}
        inactiveStatusBarBackgroundColor={STYLE_COLOR.STATUS_BAR_COLOR}
        inactiveStatusBarStyle={'dark-content'}
        translucent
      />
    </SafeAreaProvider>
  );
}
